<!-- Just an image -->
{% load static %}
<div class="container-fluid">
    <nav class="navbar navbar-expand-lg navbar-light bg-light">
      <a class="navbar-brand" href="{% url 'xtauth:index' %}">
          <img src="{% static 'images/tools.png' %}" alt="XTools" style="width: 32px; height: 32px"/></a>
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>

      <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav mr-auto">
            <li class="nav-item">
                <a class="nav-link" href="{% url 'xtversion:version' %}">版本质量报表</a>
            </li>
            <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                  加班情况
                </a>
                <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                  <a class="dropdown-item" href="{% url 'xtattend:attendance' %}">加班汇总报表</a>
                  <a class="dropdown-item" href="#">加班明细数据</a>
                </div>
            </li>

            <a class="nav-link" href="{% url 'xtattend:attendance' %}">年度账单</a>
            </li>
        </ul>

        <div>
            <a href="/admin" class="btn btn-outline-primary">去填数据</a>
{#             根据用户是否登录显示不同的按钮#}
            {% if request.user.is_authenticated  %}
            <a type="button" class="btn btn-outline-primary">{{ request.user }}</a>
            <a type="button" href="{% url 'xtauth:logout' %}" class="btn btn-outline-primary">退出</a>
            {% else %}
              <a href="{% url 'xtauth:login' %}" class="btn btn-outline-primary">登录</a>
              <a href="#" class="btn btn-outline-primary">注册</a>
            {% endif %}
        </div>

      </div>
    </nav>
</div>